from telnetlib import DO
from manimlib import *
from numpy import flip, insert

LV,QL,QH,JH='#75cfb8','#bbdfc8','#f0e5d8','#ffc478'

class p1(Scene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        for i in range(75):
            for j in range(12):
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_color(GRAY_A))
        li=[
            [],
            range(3,9),[2,9],[1,10],#(
            [],
            range(2,9),#1
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            [5],range(4,7),[5],#+
            [],
            range(2,9),#1
            [],
            range(2,9),#1
            [],
            [1,10],[2,9],range(3,9),#)
            [],
            range(3,9),[2,9],[1,10],#(
            [],
            range(2,9),#1
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            [5],[5],[5],#-
            [],
            range(2,9),#1
            [],
            range(2,9),#1
            [],
            [1,10],[2,9],range(3,9),#)
            [],
            [4,6],[4,6],[4,6],#=
            [],
            range(2,9),#1
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            [5],range(4,7),[5],#+
            [],
            range(2,9),#1
            [],
            [2,3,4,5,6,8],#!
        ]
        for i in range(len(li)):
            for j in li[i]:
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_fill(LV,1).set_color(LV))
        self.wait()

class p2(Scene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        for i in range(75):
            for j in range(12):
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_color(GRAY_A))
        li=[
            [],
            range(3,9),[2,9],[1,10],#(
            [],
            range(2,9),#1
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            [5],range(4,7),[5],#+
            [],
            range(2,9),#1
            [],
            [3,5,6,7,8],#i
            [],
            [1,10],[2,9],range(3,9),#)
            [],
            range(3,9),[2,9],[1,10],#(
            [],
            range(2,9),#1
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            [5],[5],[5],#-
            [],
            range(2,9),#1
            [],
            [3,5,6,7,8],#i
            [],
            [1,10],[2,9],range(3,9),#)
            [],
            [4,6],[4,6],[4,6],#=
            [],
            range(2,9),#1
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            range(3,8),[2,8],[2,8],[2,8],range(3,8),#0
            [],
            [5],range(4,7),[5],#+
            [],
            range(2,9),#1
            [],
            [2,3,4,5,6,8],#!
        ]
        for i in range(len(li)):
            for j in li[i]:
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_fill(LV,1).set_color(LV))
        self.wait()

class p3(Scene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        for i in range(75):
            for j in range(12):
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_color(GRAY_A))
        li=[
            [],[],[],
            range(3,9),[2,9],[1,10],#(
            [],[],
            [2,7,8],[2,6],[2,5],[2,4],[2,3],#7
            [],[],
            range(2,9),#1
            [],[],
            [5],range(4,7),[5],#+
            [],[],
            range(2,9),#1
            [],[],
            [1,10],[2,9],range(3,9),#)
            [],[],
            range(3,9),[2,9],[1,10],#(
            [],[],
            [2,7,8],[2,6],[2,5],[2,4],[2,3],#7
            [],[],
            range(2,9),#1
            [],[],
            [5],[5],[5],#-
            [],[],
            range(2,9),#1
            [],[],
            [1,10],[2,9],range(3,9),#)
            [],[],
            [4,6],[4,6],[4,6],#=
            [],[],
            [2,7,8],[2,6],[2,5],[2,4],[2,3],#7
            [],[],
            range(2,9),#1
        ]
        for i in range(len(li)):
            for j in li[i]:
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_fill(LV,1).set_color(LV))
        self.wait()

class p4(Scene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        for i in range(75):
            for j in range(12):
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_color(GRAY_A))
        li=[
            [],[],[],
            range(3,9),[2,9],[1,10],#(
            [],[],
            [2,7,8],[2,6],[2,5],[2,4],[2,3],#7
            [],[],
            range(2,9),#1
            [],[],
            [5],range(4,7),[5],#+
            [],[],
            range(2,9),#1
            [],[],
            [1,10],[2,9],range(3,9),#)
            [],[],
            range(3,9),[2,9],[1,10],#(
            [],[],
            [2,7,8],[2,6],[2,5],[2,4],[2,3],#7
            [],[],
            range(2,9),#1
            [],[],
            [5],[5],[5],#-
            [],[],
            range(2,9),#1
            [],[],
            [1,10],[2,9],range(3,9),#)
            [],[],
            [4,6],[4,6],[4,6],#=
            [],[],
            [2,7,8],[2,6],[2,5],[2,4],[2,3],#7
            [],[],
            [2,3,4,5,6,8],#!
        ]
        for i in range(len(li)):
            for j in li[i]:
                self.add(Circle(0.06).move_to([-6.5,1,0]).shift(RIGHT*i*13/75+DOWN*j*2/12).set_fill(LV,1).set_color(LV))
        self.wait()